﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace PCDoctor.Utils
{
    class ErrorHandler
    {
        protected static string getLogFile()
        {
            string x = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "log.txt");
            return Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "log.txt");
        }

        public static void HandleError(string errorText)
        {
            File.AppendAllText(getLogFile(), errorText + "\n\r\n\r");
            //Console.WriteLine("\nCatched Error: " + errorText + "\n");
        }

        public static void HandleDBError(string errorText)
        {
            Console.WriteLine("Ошибка при работе с БД: " + errorText);
        }
    }
}
